var mychart = echarts.init(document.getElementById('chart'));

mychart.setOption({

    title : {

        text: '满意度比例图',

        x:'center'

    },

    tooltip : {

        trigger: 'item',

        formatter: "{a} {b} : {c} ({d}%)"

    },

    legend:{

        orient: 'vertical',

        left: 'left',

        data: []

    },

    series : [

        {

            name: '满意度',

            type: 'pie',

            radius : '55%',

            center: ['50%', '60%'],

            data:[

                {"name":"满意","value":"1"},

                {"name":"基本满意","value":"1"},

                {"name":"不满意","value":"1"},

                {"name":"不满意","value":"1"},

                {"name":"基本满意","value":"1"}

            ],

            itemStyle: {

                emphasis: {

                    shadowBlur: 10,

                    shadowOffsetX: 0,

                    shadowColor: 'rgba(0, 0, 0, 0.5)'

                }

            }

        }

    ]

});



function changePieData(){

    var option =  mychart.getOption();

    var list =[{"name":"满意","value":"5"},{"name":"基本满意","value":"5"},{"name":"不满意","value":"5"},{"name":"不满意","value":"5"},{"name":"基本满意","value":"5"}];

    option.series[0].data = list;

    mychart.setOption(option);

}